package com.ruoyi.project.distribute.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.distribute.domain.HosProvide;
import com.ruoyi.project.distribute.mapper.HosProvideMapper;
import com.ruoyi.project.distribute.service.IHosProvideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 提供商 业务层
 * @author anran
 */
@Service
public class HosProvideServiceImpl implements IHosProvideService
{
    @Autowired
    private HosProvideMapper hosProvideMapper;

    /**
     *  查询供应商全部信息
     *
     * @param hosProvide 查询条件
     * @return 供应商集合
     */
    @Override
    public List<HosProvide> selectByHosProvide(HosProvide hosProvide)
    {
        return hosProvideMapper.selectByHosProvide(hosProvide);
    }

    /**
     * 新增供应商信息
     *
     * @param hosProvide 供应商信息
     * @return 添加结果
     */
    @Override
    public int insertHosProvide(HosProvide hosProvide)
    {
        hosProvide.setCreateTime(DateUtils.getNowDate());
        return hosProvideMapper.insertHosProvide(hosProvide);
    }

    /**
     * 删除供应商信息
     *
     * @param ids 供应商ID
     * @return 删除结果
     */
    @Override
    public int deleteHosProvideByID(Long[] ids)
    {
        return hosProvideMapper.deleteHosProvideByID(ids);
    }

    /**
     *  根据ID查询供应商信息
     *
     * @param provideId 供应商ID
     * @return 供应商信息
     */
    @Override
    public HosProvide selectHosProvideByProvideId(Long provideId)
    {
        return hosProvideMapper.selectHosProvideByProvideId(provideId);
    }

    /**
     *  修改供应商信息
     *
     * @param hosProvide
     * @return
     */
    @Override
    public int updateHosProvide(HosProvide hosProvide)
    {
        return hosProvideMapper.updateHosProvide(hosProvide);
    }
}
